<%@ page language="java" import="java.sql.*" %>
<%@page language="java" import="java.util.*" %>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Show Member &middot; CemilanSehat</title>
        <link href="css/main.css" rel="stylesheet" type="text/css" />

    </head>
    <body bgcolor="#000000" ><center>
            <div id="head">
                <div id="header"><img src="images/header.png" /></div>
                <div id="menu"><img src="images/menu.png" />
                    <table>
                        <Tr>
                            <td><a class="href" href="home-admin.jsp">Beranda</a></td>
                            <td>Profil</td>
                            <td><a class="href" href="ShowMemberServlet">Member</a></td>
                            <td><a class="href" href="ShowResepServlet">Resep Cemilan</a></td>
                            <td><a class="href" href ="ShowBahanServlet">Kandungan Kalori</a></td>
                        </Tr>
                    </table>
                </div>
            </div>


            <div id="content">
                <div id="kiri">

                    <div id="latest">

                        <form id="form1" name="form1" action="ShowMemberServlet" method="post">
                            
                            <center><h2>Daftar Member</h2></center>
                            <input type="text" name="member" placeholder="input berdasarkan kategori" size="50px">
                            <select name="kat_member" >
                                <option>id member</option>
                                <option>nama</option>
                                <option>jenis kelamin</option>
                                <option>email</option>
                                <option>role</option>
                            </select>
                            <input id="btn" type="submit" value="search">
                            <center>
                                
                                <p class="text-error">${message}</p>
                                <table class="table table-bordered" >

                                    <thead>

                                        <tr >
                                            <th ><center>No</center></th>
                                            
                                            <th ><center>Nama</center></th>
                                            <th ><center>JK</center></th>
                                            <th ><center>Email</center></th>
                                            <th ><center>Role</center></th>
                                            <th colspan="2"><center>Action</center></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <%Iterator itr;%>
                                        <%
                                                    int no = 1;
                                                    List data = (List) request.getAttribute("data");
                                                    for (itr = data.iterator(); itr.hasNext();) {
                                                        String id = String.valueOf(itr.next());
                                                        String nama = String.valueOf(itr.next());
                                                        String jk = String.valueOf(itr.next());
                                                        String email = String.valueOf(itr.next());
                                                        String role = String.valueOf(itr.next());
                                        %>
                                        <tr>
                                            <td ><%out.print(no);
                                                                                                    no++;
                                                %></td>
                                           
                                            <td ><%=nama%></td>
                                            <td ><%=jk%></td>
                                            <td ><%=email%></td>
                                            <td ><%=role%></td>


                                            <td ><a href="DeleteMemberServlet?ed_id=<%=id%>">DELETE</a></td>
                                            <td ><a href="UpdateMember1Servlet?ed_id=<%=id%>">EDIT</a></td>

                                        </tr>
                                        <%}%>
                                    </tbody>
                                </table>

                            </center>
                        </form>
                        <div id="footer"> <font color="#FFFFF">Copyright CemilanSehat.com 2013</font></div>
                    </div>
                </div>
            </div>



        </center></body>
</html>
